﻿<UserControl x:Class="Plugins.UserControls.StockParametersSelector"

             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             
             xmlns:Converters="clr-namespace:Utils.Wpf.Converters;assembly=Utils"
             xmlns:UserControls="clr-namespace:Plugins.UserControls" Background="#1F1F1F"
             
             mc:Ignorable="d"
             
             d:DesignHeight="130" 
             d:DataContext="{d:DesignInstance Type=UserControls:StockParametersSelectorVM}" >

	<UserControl.Resources>
		<ResourceDictionary>
			<Converters:MultiplierConverter x:Key="MultiplierConverter" />
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="..\PluginTheme.xaml" />
			</ResourceDictionary.MergedDictionaries>
		</ResourceDictionary>
	</UserControl.Resources>
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
			<ColumnDefinition Width="Auto" />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>

		<TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5" Text="Stock Parameters" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="Header" Margin="6" />
		<TextBlock Grid.Row="1" Grid.Column="0" Margin="3,3,6,3" Text="Fees" />
		<TextBox Grid.Row="1" Grid.Column="1" Margin="0,1,0,1" HorizontalContentAlignment="Right" Text="{Binding PercentageFee, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=Header, Converter={StaticResource MultiplierConverter}, ConverterParameter=0.55}" >
			<TextBox.ToolTip>
				<StackPanel>
					<TextBlock Foreground="Black" FontWeight="Bold" Text="Fee in %" />
					<TextBlock Foreground="Black" Text="The % over the operation amount (quantity * value). This is the amount per operation." />
				</StackPanel>
			</TextBox.ToolTip>
		</TextBox>
		<TextBlock Grid.Row="1" Grid.Column="2" Margin="3" Text="%" />
		<TextBox Grid.Row="1" Grid.Column="3" Margin="0,1,0,1" HorizontalContentAlignment="Right" Text="{Binding FixedFeePerItem, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=Header, Converter={StaticResource MultiplierConverter}, ConverterParameter=0.55}" >
			<TextBox.ToolTip>
				<StackPanel>
					<TextBlock Foreground="Black" FontWeight="Bold" Text="Fee in €" />
					<TextBlock Foreground="Black" Text="The fixed fee of each operation. This is the amount per unit and operation." />
				</StackPanel>
			</TextBox.ToolTip>
		</TextBox>
		<TextBlock Grid.Row="1" Grid.Column="4" Margin="3" Text="€" />
		<TextBlock Grid.Row="2" Grid.Column="0" Margin="3,3,6,3" Text="Fixed Fee" />
		<TextBox Grid.Row="2" Grid.Column="1" Margin="0,1,0,1" HorizontalContentAlignment="Right" Text="{Binding FixedFeePerOperation, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=Header, Converter={StaticResource MultiplierConverter}, ConverterParameter=0.55}" >
			<TextBox.ToolTip>
				<StackPanel>
					<TextBlock Foreground="Black" FontWeight="Bold" Text="Fixed fee in €" />
					<TextBlock Foreground="Black" Text="The fixed fee per operation. This is the amount per operation." />
				</StackPanel>
			</TextBox.ToolTip>
		</TextBox>
		<TextBlock Grid.Row="2" Grid.Column="2" Margin="3" Text="€" />

		<TextBlock Grid.Row="3" Grid.Column="0" Margin="3,3,6,3" Text="Reserve" />
		<TextBox Grid.Row="3" Grid.Column="1" Margin="0,1,0,1" HorizontalContentAlignment="Right" Text="{Binding PercentageReserve, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=Header, Converter={StaticResource MultiplierConverter}, ConverterParameter=0.55}" >
			<TextBox.ToolTip>
				<StackPanel>
					<TextBlock Foreground="Black" FontWeight="Bold" Text="Reserve in %" />
					<TextBlock Foreground="Black" Text="The % over the operation amount (quantity * value) needed to be able to execute it." />
				</StackPanel>
			</TextBox.ToolTip>
		</TextBox>
		<TextBlock Grid.Row="3" Grid.Column="2" Margin="3" Text="%" />
		<TextBox Grid.Row="3" Grid.Column="3" Margin="0,1,0,1" HorizontalContentAlignment="Right" Text="{Binding FixedReserve, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=Header, Converter={StaticResource MultiplierConverter}, ConverterParameter=0.55}" >
			<TextBox.ToolTip>
				<StackPanel>
					<TextBlock Foreground="Black" FontWeight="Bold" Text="Reserve in €" />
					<TextBlock Foreground="Black" Text="The fixed reserve required to do an operation for each unit bought." />
				</StackPanel>
			</TextBox.ToolTip>
		</TextBox>
		<TextBlock Grid.Row="3" Grid.Column="4" Margin="3" Text="€" />

		<TextBlock Grid.Row="4" Grid.Column="0" Margin="3,3,6,3" Text="Tick X" />
		<TextBox Grid.Row="4" Grid.Column="1" Margin="0,1,0,1" HorizontalContentAlignment="Right" Text="{Binding ValueMultiplier, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=PropertyChanged}" Width="{Binding ActualWidth, ElementName=Header, Converter={StaticResource MultiplierConverter}, ConverterParameter=0.55}" >
			<TextBox.ToolTip>
				<StackPanel>
					<TextBlock Foreground="Black" FontWeight="Bold" Text="Tick Multiplier" />
					<TextBlock Foreground="Black" Text="The number of € that each tick represents." />
				</StackPanel>
			</TextBox.ToolTip>
		</TextBox>


	</Grid>
</UserControl>
